home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / zindent7.zip / ZINFILE.INC < prev    next >
Encoding:
Text File  |  1987-03-30  |  4.9 KB  |  164 lines

  1.  
  2.  
  3. (*******************************************************************)
  4. (*                                                                 *)
  5. (* Include File                                                    *)
  6. (* SysFile.inc, v. 0800am, sun, 28.Mar.87, Glen Ellis              *)
  7. (*                                                                 *)
  8. (*******************************************************************)
  9.  
  10.  
  11. (* *)
  12. (*    function:
  13. (*      fetches parameters from text file named SYSFILE.DAT
  14. (*
  15. (*    file format:
  16. (*       for INDENT.PAS and FIND.PAS applications
  17. (*       the format is list of FILE.TYP
  18. (*       normal ASCII data
  19. (*       terminal delimiter is <0D><0A)
  20. (*       standard CP/M  MSDOS text file format
  21. (* *)
  22.  
  23.  
  24. (*-------------------------------*)
  25.  
  26. BEGIN (* INCLUDE *)
  27.    
  28.    (* sent by calling main module *)
  29.    (* SysInFilename := SysPgmName; *)
  30.    
  31.    (*$I-*);
  32.    ASSIGN( SysInFile, SysInFilename );
  33.    RESET( SysInFile );
  34.    
  35.    Writeln(Chr(7));
  36.    Writeln('---------------------------------');
  37.    Writeln('  Checking for ' + SysInFileName);
  38.    Writeln('---------------------------------');
  39.    writeln;
  40.    
  41.    (* work *)
  42.    (* modify user display, based on SysInFileName = SysPgmName *)
  43.    pIOcheck( SysIOcheck );
  44.    
  45.    (*$I+*);
  46.    
  47.    (* local I/O check to capture the IO flag from pIOcheck *)
  48.    
  49.    (*-------------------------------*)
  50.    (* NO I/O Err, so do the routine *)
  51.    
  52.    If not IOerr then
  53.    (* pgm has found the text file OK *)
  54.    begin
  55.       
  56.       (* tracer for user *)
  57.       IF SysUserTrace then
  58.       writeln('-------> SysFile.Inc  Reading ',SysInFileName);
  59.       
  60.       IF SysPgmTrace
  61.          then pDelay1;
  62.       
  63.       SysCmdUser     := true ; (* enable User Entry Module    *)
  64.       SysCmdUserFile := false; (* have the list already       *)
  65.       SysCmdUserParm := true ; (* enable User Entry of Parms  *)
  66.       
  67.       SysInFileName := '             '; (* empty name *)
  68.       SysInSourceMax := 0; (* initz for reading into array *)
  69.       
  70.       WHILE not eof(SysInFile) do
  71.       begin
  72.          
  73.          (* inc tail-end counter *)
  74.          SysInSourceMax := SysInSourceMax + 1;
  75.          
  76.          (* fetch line *)
  77.          readln(SysInFile,SysInSource[SysInSourceMax]);
  78.          
  79.       end; (* while *)
  80.       
  81.       writeln;
  82.       
  83.       CLOSE( SysInFile );
  84.       pIOcheck( SysIOcheck );
  85.       
  86.    end; (* not IOerror *)
  87.    
  88.    
  89.    (* error recovery *)
  90.    IF IOerr then
  91.    (* procedure IOCHECK has already displayed small message *)
  92.    begin
  93.       
  94.       (* lock the CORE *)
  95.       (* redundancy OK . Clear the Process ! *)
  96.       SysCmdLine := false;
  97.       SysCmdFile := false;
  98.       (**)  SysCmdUser := true ;
  99.       SysCmdUserFile := true;
  100.       SysCmdUserParm := true;
  101.       
  102.       
  103.       SysInSourceMax := 0; (* no entries in array *)
  104.       
  105.       SysInFileName := '?';  (* enable Documents module *)
  106.       
  107.       IF SysUserTrace
  108.       then
  109.       begin
  110.          writeln;
  111.          writeln('----------------------------------------------');
  112.          writeln;
  113.          writeln(' ', SysPgmName,' with filename list  not found');
  114.          writeln;
  115.          writeln('  User Entry / Documentation coming next.');
  116.          writeln;
  117.          writeln('  wait . . . .');
  118.          pDelay4;
  119.       end;
  120.       
  121.       CLOSE( SysInFile );
  122.       pIOcheck( SysIOcheck );
  123.       
  124.    end;
  125.    
  126.    (**)
  127.    (*
  128.    (* Developer's note to himself :
  129.    (*
  130.    (* Default settings will be manually inserted.
  131.    (* Required originally for INDENT.PRO called by KEYWORD.PRO.
  132.    (* Indent.pro was written into STRING.INC for consistency.
  133.    (* Default output is for a 'running' dBASE/Pascal source file
  134.    (*         with indents and comments, but no line numbering.
  135.    (*
  136.    (* These defaults are to be modified for each application
  137.    (* which incorporates the System.Pas CORE module series.
  138.    (*
  139.    (* install defaults above, or here ... but somewhere !
  140.    (*
  141.    (**)
  142.    
  143.    (* Array Has Been Loaded, clean the vars   *)
  144.    (*SysInFilename installed above *)
  145.    SysOutFilename := '        ';
  146.    SysInSourceCnt := 0 ;
  147.    (* InSourceMax installed above *)
  148.    
  149.    (* from sysFILE method : Default Operation Modes *)
  150.    SysIndent    := true;    (* enable indent procedure        *)
  151.    SysComment   := true;    (* enable comment line write      *)
  152.    SysLineCnt   := false;   (* disable line number write      *)
  153.    SysVertiate  := false;   (* disable vertical markers       *)
  154.    
  155.    (* Default Operating Parameters *)
  156.    SysIndentNum := 3;       (* standard, useful figure        *)
  157.    SysIndentPos := 0;       (* always                         *)
  158.    SysLenMax    := 79;      (* print page                     *)
  159.    
  160.    
  161. END; (* INCLUDE *)
  162.  
  163.  
  164. (*******************************************************************)
  165. (*<<<>>>*)